﻿@{
    ViewData["Title"] = "Logon";
    Layout = null;
}

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>登录</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link href="~/layuiadmin/layui/css/layui.css" rel="stylesheet" asp-append-version="true"  />
    <link href="~/layuiadmin/style/admin.css" rel="stylesheet" asp-append-version="true" />
    <link href="~/layuiadmin/style/login.css" rel="stylesheet" asp-append-version="true"  />
    <style>
        .layadmin-user-login-main {
            color: #000;
        }
    </style>
</head>
<body style="background-image: url(/img/bg.jpg);background-size: 100%  100%;  ">

    <div class="layadmin-user-login layadmin-user-display-show" id="LAY-user-login" style="display: none;">

        <div class="layadmin-user-login-main" style="background: rgba(255,255,255,.8);">
            <div class="layadmin-user-login-box layadmin-user-login-header">
                <h2>基于角色控制的管理系统</h2>
            </div>
            <form method="post" action="/account/logon" class="layadmin-user-login-box layadmin-user-login-body layui-form">
                <div class="layui-form-item">
                    <label class="layadmin-user-login-icon layui-icon layui-icon-username" for="LAY-user-login-username"></label>
                    <input type="text" name="username" id="LAY-user-login-username" lay-verify="required" placeholder="用户名" class="layui-input">
                </div>
                <div class="layui-form-item">
                    <label class="layadmin-user-login-icon layui-icon layui-icon-password" for="LAY-user-login-password"></label>
                    <input type="password" name="password" id="LAY-user-login-password" lay-verify="required" placeholder="密码" class="layui-input">
                </div>
                <div class="layui-form-item">
                    <button id="btn-logon" class="layui-btn layui-btn-fluid" type="button" lay-submit="" onkeyup="" lay-filter="LAY-user-login-submit">登 入</button>
                </div>
            </form>
        </div>
    </div>

    <script src="/layuiadmin/layui/layui.all.js" asp-append-version="true" ></script>
    <script src="~/jquery/jquery.js" asp-append-version="true" ></script>
    <script src="~/jquery/jquery.form.js" asp-append-version="true" ></script>
    <script src="~/app.js"></script>
    <script>

        $(function () {
            if (window != top) {
                top.location.href = location.href;
            }
            var form = layui.form;
            form.render();

            document.onkeyup = function (e) {
                var code = e.charCode || e.keyCode;
                if (code == 13) {
                    $("#btn-logon").click();
                }
            }

            var logon = function () {
                $(".layui-form").formPost(function () {
                    location.href = '/home/Index';
                });
            }
            //提交
            form.on('submit(LAY-user-login-submit)', function () {
                logon();
            });
        })
    </script>
</body>
</html>